import { mapGetters } from 'vuex'

export default {
  computed: {
    ...mapGetters('user', [
      'authorities',
      'currentUser'
    ])
  },
  methods: {
    hasAuthority: function (authoritys) {
      for (let authority of authoritys) {
        for (let {authority: auth} of this.authorities) {
          if (auth === authority) return true
        }
      }
      return false
    }
  }
}
